---
title: "Pk82033_ThirdParty stored procedure documentation"
summary: "Analysis of the Pk82033_ThirdParty Oracle package including business rules and operations."
status: draft
owner: "SAIF Corporation"
last_reviewed: 2026-08-31
source_schema: "WCIS_DBA"
source_name: "Pk82033_ThirdParty"
source_type: "PACKAGE"
retrieval_status: "found"
retrieval_command: "legends oracle query --name Pk82033_ThirdParty"
retrieval_date: "2026-08-31"
---

# Pk82033_ThirdParty

## Overview

| Field | Value |
| --- | --- |
| **Schema** | `WCIS_DBA` |
| **Type** | Package (92 members; 1 invoked by this library) |
| **Database** | Oracle |
| **Status** | ✅ `found` — retrieved via Legends CLI |
| **Query executed** | `legends oracle query --name Pk82033_ThirdParty` |
| **Calling libraries** | `SAIF.Business.View.Policy` |
| **Calling classes** | `clsPolicyData` |

## Purpose

`Pk82033_ThirdParty` is a large (92-member) third-party administration package. This library invokes
only one member, `get_policy_waiver_count`, to determine whether a policy has any waiver detail rows.

## Procedures / Methods

### get_policy_waiver_count

| Field | Value |
| --- | --- |
| **Returns** | `NUMBER` (function return value) |
| **Called by** | `clsPolicyData.RetrieveHasWaiver` (`clsPolicyData.vb:1532-1552`, SQL at `2267`) |

**Description:** Counts waiver detail rows for a policy. The caller converts the count to a Boolean via
`CBool`, so any count greater than zero means "has waiver" (see rule PR-BVP-041 in
[Business Rules](#business-rules) below).

#### Parameters

| Parameter | Direction | Type | Default | Description |
| --- | --- | --- | --- | --- |
| `PolicyNum` | IN | `POLICY.POLICY_NUM%TYPE` | — | Policy number |
| *(return)* | RETURN | `NUMBER` | — | Waiver row count |

## Business Rules

Rules extracted from this package's logic:

| Rule ID | Rule | Condition | Action |
| --- | --- | --- | --- |
| PR-BVP-041 | Waiver presence is a count over waiver detail | always | `SELECT COUNT(*) FROM WAIVER_DETAIL WHERE POLICY_NUM = PolicyNum`; caller converts to Boolean via `CBool`, so any count > 0 means "has waiver" (`clsPolicyData.vb:1532-1552`) |

> These rules are documented in [business-rules.md](../business-rules.md).

## Operations

Operations and processes implemented in this package:

| Operation | Description | Trigger |
| --- | --- | --- |
| Count policy waivers | Counts waiver detail rows for a policy; caller reduces to a Boolean `HasWaiver` | `clsPolicyData.RetrieveHasWaiver` (`clsPolicyData.vb:1532-1552`, SQL at `2267`) |

> These operations are also listed in [operations-processes.md](../operations-processes.md) with source reference back to this document.

## Source Code

<details>
<summary>PL/SQL function (specification and body)</summary>

```sql
FUNCTION get_policy_waiver_count (PolicyNum IN POLICY.POLICY_NUM%TYPE)
   RETURN NUMBER
IS
   v_count NUMBER;
BEGIN
   SELECT COUNT (*)
     INTO v_count
     FROM WAIVER_DETAIL
    WHERE POLICY_NUM = PolicyNum;

   RETURN v_count;
END;
```

</details>

## Related Documentation
- [Procedure catalog](index.md)
- [Business rules](../business-rules.md)
- [Operations and processes](../operations-processes.md)
- [SQL catalog](../sql/index.md)

## Sources
- Oracle DBA_SOURCE: `WCIS_DBA.Pk82033_ThirdParty`
- Legends CLI query executed 2026-08-31: `legends oracle query --name Pk82033_ThirdParty`
- Calling code: `SAIF.Business.View.Policy/clsPolicyData.vb:1532-1552`
